console.log("--------武器类型-------")
let weaponHeaderType = new Vue({
    el: "#weaponHeaderType",
    data: {
        weaponTypeList: [],
        uname:""
    },
    methods: {
        weaponTypeListInfo() {
            let vueObj = this;
            $.get("/weaponType/allTypes/", function (data) {
                console.log(data);
                vueObj.weaponTypeList = data;
            })
        },
        weaponOfType(typeId){
            console.log(typeId);
            sessionStorage.setItem("typeId",typeId);
            location.href="/weaponType.html";
        },
        isLogin(){
            let vueObj = this;
            $.post("/user/isLogin",function (data) {
                vueObj.uname = data;
                console.log(vueObj.uname)
            })
        },
        toOut(){
            $.post("/user/exit",function () {
                location.href="/index.html";
            })
        }
    },
    created() {
        this.weaponTypeListInfo();
        this.isLogin();
    }
})
let checkLogin = function (data, callback) {
    //如果需要登录,那就跳转到登录页
    if (data == "toLogin"){
        location.href = "/login.html"
        parent.location.href = "/login.html"
        return
    }
    callback(data);
}
